package cn.kgc.vue.controller;

import cn.kgc.vue.entity.User;
import cn.kgc.vue.service.UserService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @author 课工场
 * @date 2023/10/31
 * @description
 */
@RestController
@RequestMapping("user")
@CrossOrigin    // 当前接口允许跨域请求
public class UserController {

    @Resource
    private UserService userService;

    @PostMapping("register")
    public  Map   register(@RequestBody  User user){

       return userService.register(user);
    }


    @GetMapping("login")
    public  Map   login(User user){

        return userService.login(user);
    }

}
